package com.jcfk.eam.controller.mould;

import com.jcfk.common.web.domain.RetResult;
import com.jcfk.eam.domain.dto.base.EamSopStandardDTO;
import com.jcfk.eam.domain.query.base.EamSopStandardQuery;
import com.jcfk.eam.enums.AssetKind;
import com.jcfk.eam.enums.TaskKind;
import com.jcfk.eam.service.main.EamPointInspectionService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 模具点检
 */
@Api(tags = {"模具点检"})
@RestController
@RequestMapping("mouldPointInspection")
public class MouldPointInspectionController {

    @Autowired
    private EamPointInspectionService pointInspectionService;

    /**
     * 获取点检标准列表
     * @param query
     * @return
     */
    @PostMapping("getSopStandardList")
    public RetResult<?> getSopStandardList(@RequestBody EamSopStandardQuery query){
        query.setAssetKind(AssetKind.MOULD.getValue());
        query.setTaskKind(TaskKind.POINT_INSPECTION.getValue());
        List<EamSopStandardDTO> list=pointInspectionService.getSopStandardList(query);
        return RetResult.ok(list);
    }
}
